<template>
	<view class="information">
		<view class="search">
			<text class="iconfont icon-sousuo"></text>
			<input type="text" value="" placeholder="搜索关键字" />
		</view>
		<view class="nav">
			<text class="all">全部</text>
			<text class="system">系统消息</text>
		</view>
		<view class="contents" @click="goCommunity(item.userid,item.photo)" v-for="(item,index) in contactStaffList">
			<view class="photo">
				<image  :src="URL+item.photo" mode=""></image>
			</view>
			<view class="content">
				<view class="conLt">
					<text class="name">{{item.name}}</text>
					<text class="message">{{item.typename}}</text>
				</view>
				<view class="conRt">
					上午 {{item.addtime | timeFormat}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {contactStaff} from '../../api/MyHouse.js'
	import {IMGBASEURLS,IMGBASEURL} from '../../utils/config.js';
	import moment from 'moment'
	export default{
		data(){
			return{
				URL:IMGBASEURLS,
				contactStaffList:[]
			}
		},
		onLoad() {
			this.getcontactStaff()
		},
		filters: {
			timeFormat(val) {
				return moment(val).format("HH:mm")
			}
		},
		methods:{
			goCommunity(userid,photo){
				uni.navigateTo({
					url:'/pages/particulars/page?userid='+userid+'&photo='+photo
				})
			},
			async getcontactStaff(){
				let res = await contactStaff()
				console.log(res)
				if(res.errCode == '10000'){
					this.contactStaffList = res.data.list
				}
			}
		}
	}
</script>

<style lang="less">
	@import './../../static/style/information.less';
</style>
